<template>
    <basic-container>
        <div style="width: 70%;">
            <el-form :model="ruleForm"  ref="ruleForm" label-width="160px" class="demo-ruleForm">
                <el-form-item label="是否隐藏下级人脉" prop="myContactsSwitch">
                    <el-switch v-model="ruleForm.myContactsSwitch"
                               active-color="#13ce66"
                               inactive-color="#ff4949"
                               active-value="true"
                               inactive-value="fasle"></el-switch>
                </el-form-item>
                <el-form-item label="h5地址域名" prop="domainH5">
                    <el-input v-model="ruleForm.domainH5" placeholder="请输入内容"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitForm()" size="medium"><i class="el-icon-check"></i> 提交</el-button>
                </el-form-item>
            </el-form>
        </div>
    </basic-container>
</template>
<script>
    import {
        getMinMao,
        setMinMao
    } from '@/api/base/sysSet/minmaoSet'
    export default {
        data() {
            return {
                ruleForm: {
                    myContactsSwitch:'',
                    domainH5:'',
                },
            };
        },
        created(){
            this.getData()

        },
        methods: {
            //获取数据
            getData(){
                getMinMao().then(res=>{
                    if(res.data.code==200){
                        this.ruleForm=res.data.data
                    }
                })
            },
            submitForm() {
                setMinMao(this.ruleForm).then(res=>{
                    if(res.data.code==200){
                        this.$message({
                            message:'提交成功',
                            type:'success'
                        })
                        this.getData()
                    }
                })
            },
        }
    }
</script>